package com.usercar.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public  class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117689604";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCPJxwhoRtkJXWxjlNK4M12wmqTM7GJHuu+a54VgRjRFQiMQw75waoDmS1YGRQJS5gIuW/WA8Be9tl37KSEFWWRdhSW6Z52TagEeIUUfr7I/KoJmE4z7ExoNej5sorEzsgDEZueGGFIeVOGOoSuN8mKTV2f9iNS+opNYyMFZ7dUMHniDa8tBhvAFGcvqE3DuZHxvRHf8HA/5gclAMSIk1vlfaGbzAaMX6UhejCRKOhFbaMiONjHem0mCkdiDQ9NINtp4Z+0MDz9FeGCMo5dzUOzg+fRz5cXxKchIpC3dUQwDbhyNqK/7vXUOpwhpoZSMYY4cQ4EEmZ2klAmGfqCCfZlAgMBAAECggEADGcJCujYZK7SKZX5JW2gn39smGBMK2MgbZkJUzeiHMtDuFM/AuiCgFlPEmjp0XxZKbhXNiWRDyk34ioAfukTqayfUAvhjMJhojGG5iWtBeDOIpKtg9YfMJArJScQ2shHj+yAnQvjsdHBKMn9INL4hSD60ZcTrGbEgLvsFtXLjmGbSTjK0fc/Ixp9nir9igEIvh5z9vcoOBEIkszpKFLK8gGYUgsuni50XoJdoqJ5Hlw4iX1ii/6XB+fhPqlBqObGRtaTAg9QL//iGs7ubwSBTfXdoiSghK33q46eT3qd7gz0kC1zoJqByKYoFOtjxipboypVJY2maL7wWjpIqByAqQKBgQDdJ85wCmTfVD2W3ShKJkCnXTWnFTsDT2ULydglsrK4+TA5hYJWrWu8or1mEMZhbDYENui4xxA918ecjxGnccIsgZdztvZ/hTxDGUOuELGt7WGIZBdszxOp+v5Tl53rDEw5qHkzpo+5faBZvGRXlCxAu9fqCgrecwtKcfR5lrAifwKBgQCltRqLYxmoKWYQxBcRAYm+tE5ViY2yOh5N3xq8Wz64KvKtoF1QllDC2YIVB3ViSoD7FrCEknFxSild+QMlZIC3IWu5FKfrfLdZN2GzN5q2wZKn7U1H5E6vWfpQgdEnJ2m6yrswPw7f2/h07xDqxa3nMAsDszVAINzoQTzomZotGwKBgEXC5cK/9JviFd99+dSSBnkE1QTUlJ3xsH0seYtCuE/TAxxR+hBfegmyCC6nAfz/RnbD31tSJ9RqOaQwGTCJmOezJVQyFcWaAK1lzcydpX6oz8hXUnBXTeujqhAyVnUrluvlMf5R/ypS737/B2P88Iym9G/2JQGQprIgCi9EkmD/AoGASodd3PtBeuTDxx6q0TdD4MXvxYEMffCt2JBT0gun9eU7KORLlAdHY5u4agTkwsSHpmbaFYZYB4A3gtCQnazKR5N8g83KiJubS0EhbB3CNBh0AZs1evQwf6WUc8kvbNDJOP4dmuGBqyWgZddwYGdwg96T1aIwfRtKwBs3bdZIBakCgYBAekO+1LON2q3HDuWjlrlKLyu0VWuAWamExLU6CFNP3IGO6VHIu1H4juzqUxVyu0+hL2e3xFzl3kS+LbAcNWKz6gKMmNrSvR6uD0kX/pwLvW8SXdw1UC4Z2WgQeWmMgP2Hpb/hCxKFVBhdgN4fQokrtvSJ/POZ4GGeVfHclXvIgg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgNKNCNI+VuAUcObAx0697GlJ/ATrF0GZa+iAjRZJHqipo98eYfoobEGrtpvll4dPK9yVy+kDvgrHfW14vQV6OP20Y/jdlxdq9TrzwSxiEeRY8LNxcTnMy+fsfs8rnvS1VdP+bpRtD1aW3oFi97TjhKdXcDYu12hTMYNUgVELsc6eIlXA2sv8WOCGcGay6+PSu62yL1jrQyzQMFW0fNYUI0UGXOFXqnHTGHYOLJgEkjEgknpt31xPl5xaryAk9b6ux9vajumdkBr8PpwnuIiftOqk2z5ySFVjps4RFIeazk2P6nibg6c5uRUuwZzNkM350d7MzgJl5yR2PKbJ629kuQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://39we114201.51vip.biz/callBankController/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://39we114201.51vip.biz/callBankController/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

